import os

from pydantic_settings import BaseSettings

from pydantic_settings import BaseSettings


class BaseConfig(BaseSettings):
    DEBUG: bool = False
    TEMP_DIR: str
    ASSETS_DIR: str

class TaskConfig(BaseSettings):
    CELERY_BROKER: str
    CELERY_BACKEND: str



class AliyunOSSConfig(BaseSettings):
    ALIYUN_OSS_ENDPOINT: str
    ALIYUN_OSS_BUCKET_NAME: str
    ALIYUN_OSS_REGION: str
    ALIYUN_OSS_ACCESS_KEY_ID: str
    ALIYUN_OSS_ACCESS_KEY_SECRET: str


class Settings(BaseConfig, TaskConfig, AliyunOSSConfig):
    class Config:
        env_file = f".env.{os.getenv('ENV', 'development')}"  # 或者根据你的项目配置加载正确的 .env 文件


settings = Settings()  # 会自动读取 .env 文件
